<template>
	<view>
		<view class="bj">
			<u-navbar title="已完成订单" :autoBack="true" bgColor="#3284fc"
				titleStyle="font-size:18px; color:white;height:44px;line-height:44px" leftIconColor="#fff">
			</u-navbar>
			<u-cell-group :border="false"
				:customStyle="{backgroundColor:'#ffffff',borderRadius:'10px',margin:'10px auto',width:'350px',}">
				<u-cell>
					<template v-slot:title>
						<span style="font-size: 16px;font-weight: 600;">订单信息</span>
					</template>
					<template v-slot:value>
						<span style="color: red;">已完成</span>
					</template>
				</u-cell>
				<view class="xq">
					<view>订单号：{{order.number}}</view>
					<view>服务项目：
						<span v-if="order.serviceList != null">
							{{order.serviceList[0].name}}
						</span>
					</view>
					<view class="zb">
						<view>服务门店：
							<span v-if="order.shop != null">
								{{order.shop.storeName}}
							</span>
						</view>
						<u-icon name="/static/images/plane@2x.png" size="15"></u-icon>
					</view>
					<view>下单时间：{{order.createTime}}</view>
					<view>预约时间：{{order.subscribeTime}}</view>
					<view>车辆：
						<span v-if="order.car != null">
							{{order.car.carNumber}}
						</span>
					</view>
					<view>备注：</view>
				</view>
			</u-cell-group>
			<u-cell-group :border="false"
				:customStyle="{backgroundColor:'#ffffff',borderRadius:'10px',margin:'10px auto',width:'350px',}">
				<u-cell>
					<template v-slot:title>
						<span style="font-size: 16px;font-weight: 600;">订单详情</span>
					</template>
				</u-cell>
				<view class="xq">
					<view class="fy">
						<view>车辆精铣</view>
						<view>
							<span v-if="order.serviceList != null">
								￥{{order.serviceList[0].newPrice}}
							</span>
						</view>
					</view>
					<view class="fy">
						<view>车辆附加费用</view>
						<view>0</view>
					</view>
					<u-line margin="20rpx 0"></u-line>
					<view class="fy">
						<view>原价</view>
						<view>
							<span v-if="order.serviceList != null">
								￥{{order.serviceList[0].oldPrice}}
							</span>
						</view>
					</view>
					<view class="fy">
						<view>店家优惠</view>
						<view style="color: red;">0</view>
					</view>
					<u-line margin="10rpx 0"></u-line>
					<view class="fy">
						<view>优惠卷</view>
						<view style="color: red;">0</view>
					</view>
					<u-line margin="20rpx 0"></u-line>
					<view class="fy">
						<view>支付金额</view>
						<view style="color: #1b9c35;">￥{{order.totalPrice}}</view>
					</view>
				</view>
			</u-cell-group>
			<u-cell-group :border="false"
				:customStyle="{backgroundColor:'#ffffff',borderRadius:'10px',margin:'10px auto',width:'350px',}">
				<u-cell>
					<template v-slot:title>
						<span style="font-size: 16px;font-weight: 600;">评价结果</span>
					</template>
				</u-cell>
				<view class="xq">
					<view>评价时间：2022-10-10 11:09</view>
					<view class="pj">
						<view>评价结果：</view>
						<u-rate active-color="#ffc100" :value="5" inactive-color="#b2b2b2" readonly gutter="0"></u-rate>
					</view>

					<view>评语：评语评语评语评语评语</view>
				</view>
			</u-cell-group>
			<view class="db">
				<view class="kf">
					<u-icon name="/static/images/kf@2x.png" size="20"></u-icon>
					<view style="margin-left: 10px;">联系客服</view>
				</view>
				<u-button text="再来一单"></u-button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: '',
				order: ''
			}
		},
		onLoad(e) {
			// console.log(e.id)
			this.id = e.id;
			this.getOrder()
		},
		methods: {
			getOrder() {
				let that = this;
				this.$http({
					url: 'api/order/order/' + this.id,
					method: 'GET',
					success(res) {
						console.log(res)
						that.order = res.data.data

					}
				})
			}
		}
	}
</script>

<style scoped>
	.pj {
		display: flex;
	}

	.kf {
		display: flex;
		align-items: center;
	}

	.db {
		margin-top: 50px;
		width: 100%;
		height: 60px;
		background-color: #ffffff;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.db .u-button {
		width: 100px;
		height: 35px;
		background-color: #3183fc;
		color: #fff;
		margin-right: 25px;
		border-radius: 20px;
	}

	.fy {
		display: flex;
		justify-content: space-between;
	}

	.xq {
		padding: 10px 20px;
		line-height: 30px;
	}

	.u-icon {
		margin-left: 10px;
	}

	.zb {
		display: flex;
	}

	image {
		width: 100px;
		height: 100px;
		margin: -10px auto 20px;
	}

	.bj {
		width: 100%;
		height: 150px;
		background-color: #3384fc;
		margin-top: 44px;
	}
</style>